package com.ruoyi.dl.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dl.mapper.DlWithdrawMapper;
import com.ruoyi.dl.domain.DlWithdraw;
import com.ruoyi.dl.service.IDlWithdrawService;
import com.ruoyi.common.core.text.Convert;

/**
 * 提现充值记录Service业务层处理
 *
 * @author wangshouli
 * @date 2021-01-04
 */
@Service
public class DlWithdrawServiceImpl implements IDlWithdrawService {
    @Autowired
    private DlWithdrawMapper dlWithdrawMapper;

    /**
     * 查询提现充值记录
     *
     * @param id 提现充值记录ID
     * @return 提现充值记录
     */
    @Override
    public DlWithdraw selectDlWithdrawById(Integer id) {
        return dlWithdrawMapper.selectDlWithdrawById(id);
    }

    /**
     * 查询提现充值记录列表
     *
     * @param dlWithdraw 提现充值记录
     * @return 提现充值记录
     */
    @Override
    public List<DlWithdraw> selectDlWithdrawList(DlWithdraw dlWithdraw) {
        return dlWithdrawMapper.selectDlWithdrawList(dlWithdraw);
    }

    /**
     * 新建查询提现充值记录列表
     *
     * @param dlWithdraw 提现充值记录
     * @return 提现充值记录
     */
    @Override
    public List<DlWithdraw> newSelectDlWithdrawList(DlWithdraw dlWithdraw) {
        return dlWithdrawMapper.newSelectDlWithdrawList(dlWithdraw);
    }

    /**
     * 新增提现充值记录
     *
     * @param dlWithdraw 提现充值记录
     * @return 结果
     */
    @Override
    public int insertDlWithdraw(DlWithdraw dlWithdraw) {
        dlWithdraw.setCreateTime(DateUtils.getNowDate());
        return dlWithdrawMapper.insertDlWithdraw(dlWithdraw);
    }

    /**
     * 修改提现充值记录
     *
     * @param dlWithdraw 提现充值记录
     * @return 结果
     */
    @Override
    public int updateDlWithdraw(DlWithdraw dlWithdraw) {
        return dlWithdrawMapper.updateDlWithdraw(dlWithdraw);
    }

    /**
     * 删除提现充值记录对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDlWithdrawByIds(String ids) {
        return dlWithdrawMapper.deleteDlWithdrawByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除提现充值记录信息
     *
     * @param id 提现充值记录ID
     * @return 结果
     */
    @Override
    public int deleteDlWithdrawById(Integer id) {
        return dlWithdrawMapper.deleteDlWithdrawById(id);
    }
}
